
// #ifndef VUE3
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);



// 引入用户登录相关的全局mixins
// 已将常用的请求参数字段都映射到了this身上，可在任何页面直接this.xxx使用。
// 包含以下字段：'userId', 'userInfo', 'accessToken', 'userServiceToken', 'adminId', 'openId', 'businessId', 'businessList', 'storeInfo'
// 详情请见  @/tools/store/modules/app_store.js
import appMixin from '@/tools/mixins/app_mixin.js';
Vue.mixin(appMixin);

import businessMixin from '@/tools/mixins/business_mixin.js';
Vue.mixin(businessMixin);

// 引入模板的全局mixins
import templateMixin from '@/tools/mixins/template_mixin.js';
Vue.mixin(templateMixin);

// 引入设置导航高度的全局mixins
import naviMixin from '@/tools/mixins/navi_mixin.js';
Vue.mixin(naviMixin);

// 引入全局加入购物车mixins
import cartMixin from '@/tools/mixins/cart_mixin.js'
Vue.mixin(cartMixin);

// 引入全局店铺mixins
import firmMixin from '@/tools/mixins/firm_mixin.js'
Vue.mixin(firmMixin);

uni.$showMsg = (msg = '数据加载失败', duration = 1000) => {
	uni.showToast({
		title: msg,
		icon: 'none',
		duration: duration
	})
}

// 挂载全局事件总线
Vue.prototype.$bus = new Vue();

//导入 store 的实例对象
import store from '@/tools/store/index.js'

App.mpType = 'app'

const app = new Vue({
    ...App,
	store,
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif